'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);

  // 注册路由
  router.post('/api/registry', controller.user.registry);
  // 登录路由
  router.post('/api/login', controller.user.login);
  // 上传头像路由
  router.post('/api/uphead', controller.user.uphead);
  // RESTful 风格的 URL 定义
  router.resources('list', '/api/list', controller.list)
};
